using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.IO;
using System.Xml;

namespace MG1
{

    public class MAIN : Game
    {
        ContentManager content;

        public MAIN()
        {
            Content.RootDirectory = "Content";

            G.SetUP(this);

            G.graph.PreferredBackBufferWidth = G.Config.Settings.ScreenWidth;
            G.graph.PreferredBackBufferHeight = G.Config.Settings.ScreenHeight;
            if (G.Config.Settings.FullScreen)
                G.graph.ToggleFullScreen();
            G.graph.SynchronizeWithVerticalRetrace = G.Config.Settings.vSync;
            G.Game.IsFixedTimeStep = G.Config.Settings.FixedTimeStep;
            IsMouseVisible = true;

            
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
        }


        protected override void LoadContent()
        {
            G.spriteBatch = new SpriteBatch(G.graph.GraphicsDevice);
            content = new ContentManager(G.Game.Services, "Content");
        }

        protected override void UnloadContent()
        {
        }

        protected override void Update(GameTime gameTime)
        {
            //G.input.UpdateNewButtonState();
            //G.input.UpdateKeys();
            //// TODO: Add your update logic here
            //G.input.UpdateOldButtonState();
            

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            //GraphicsDevice.Clear(Color.Black);
            base.Draw(gameTime);
        }

    }
}
